cmake_minimum_required(VERSION 3.0.0)

set(MODULE_NAME "FinalC")
if(${CMAKE_CURRENT_SOURCE_DIR} STREQUAL ${CMAKE_SOURCE_DIR})
    set(${MODULE_NAME}_INCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR};${CMAKE_CURRENT_SOURCE_DIR}/include")
    set(${MODULE_NAME}_LIBRARIES ${MODULE_NAME})
else()
    set(${MODULE_NAME}_INCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR};${CMAKE_CURRENT_SOURCE_DIR}/include" PARENT_SCOPE)
    set(${MODULE_NAME}_LIBRARIES ${MODULE_NAME} PARENT_SCOPE)
endif(${CMAKE_CURRENT_SOURCE_DIR} STREQUAL ${CMAKE_SOURCE_DIR})

include_directories(
    ${CMAKE_CURRENT_SOURCE_DIR}/include
)

add_library(${MODULE_NAME}
    "src/FinalC.c"
    "src/FinalCType/List.c"
    "src/FinalCType/String.c"
    "src/FinalCType/StringList.c"   
    "src/FinalCType/File.c"
    "src/FinalCType/FilePermissions.c"
)

# add_subdirectory(lib/FinalC)
# target_include_directories(${MODULE_NAME} PRIVATE
#     ${FinalC_INCLUDE_DIRS}
# )
# target_link_libraries(${MODULE_NAME}
#     ${FinalC_LIBRARIES}
# )